/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades.Revision;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Roggers
 */
@Entity
@Table(name = "palabrasclave")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Palabrasclave.findAll", query = "SELECT p FROM Palabrasclave p"),
    @NamedQuery(name = "Palabrasclave.findByPalabra", query = "SELECT p FROM Palabrasclave p WHERE p.palabra = :palabra"),
    @NamedQuery(name = "Palabrasclave.findByIdPalabrasClave", query = "SELECT p FROM Palabrasclave p WHERE p.idPalabrasClave = :idPalabrasClave")})
public class Palabrasclave implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "palabra", nullable = false, length = 50)
    private String palabra;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "idPalabrasClave", nullable = false)
    private Integer idPalabrasClave;

    public Palabrasclave() {
    }

    public Palabrasclave(Integer idPalabrasClave) {
        this.idPalabrasClave = idPalabrasClave;
    }

    public Palabrasclave(Integer idPalabrasClave, String palabra) {
        this.idPalabrasClave = idPalabrasClave;
        this.palabra = palabra;
    }

    public String getPalabra() {
        return palabra;
    }

    public void setPalabra(String palabra) {
        this.palabra = palabra;
    }

    public Integer getIdPalabrasClave() {
        return idPalabrasClave;
    }

    public void setIdPalabrasClave(Integer idPalabrasClave) {
        this.idPalabrasClave = idPalabrasClave;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPalabrasClave != null ? idPalabrasClave.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Palabrasclave)) {
            return false;
        }
        Palabrasclave other = (Palabrasclave) object;
        if ((this.idPalabrasClave == null && other.idPalabrasClave != null) || (this.idPalabrasClave != null && !this.idPalabrasClave.equals(other.idPalabrasClave))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.Revision.Palabrasclave[ idPalabrasClave=" + idPalabrasClave + " ]";
    }
    
}
